<link rel="stylesheet" href="https://cdn.bootcss.com/simplemde/1.11.2/simplemde.min.css">
<script src="https://cdn.bootcss.com/simplemde/1.11.2/simplemde.min.js"></script>
<div class="row">
    <div class="col-md-12">
        <div class="box box-primary">
            {include file="template/form_header" /}
            <form id="dataForm" class="form-horizontal" method="post" enctype="multipart/form-data">
                <div class="box-body">
                    <div class="fields-group">
                        <div class="form-group">
                            <div class="col-sm-12">
                                <textarea name="content" id="content" class="form-control"></textarea>
                            </div>
                        </div>
                    </div>
                </div>
                {include file="template/form_footer" /}
            </form>
        </div>
    </div>
</div>
<script>
    var simplemde = new SimpleMDE({
        spellChecker: false,
        autosave: {
            enabled: true,
            delay: 5000,
            unique_id: "content"
        },
        forceSync: true,
        toolbar: [
            "bold", "italic", "heading", "|", "quote", "code", "table",
            "horizontal-rule", "unordered-list", "ordered-list", "|",
            "link", "image", "|", "side-by-side", 'fullscreen', "|",
            {
                name: "publish",
                action: function customFunction(editor) {
                    $('#save').click();
                },
                className: "fa fa-paper-plane",
                title: "预览"
            }
        ]
    });
</script>